package com.tsoj.tsojuserservice.controller.inner;

import com.tsoj.model.po.User;
import com.tsoj.tsojserviceclient.service.UserFeignClient;
import com.tsoj.tsojuserservice.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
@RestController
@RequestMapping("/inner")
@Api(tags = "用户内部服务")
public class UserInnerController implements UserFeignClient {
    @Autowired
    private UserService userService;
    @Override
    @GetMapping("/get/vo/{id}")
    @ApiOperation(value = "根据id查询用户 内部")
    public User getById(long id) {
        return userService.getById(id);
    }

    @Override
    @GetMapping("/get/ids")
    @ApiOperation(value = "根据id列表查询用户 内部")
    public List<User> listByIds(Collection<Long> idList) {
        return userService.listByIds(idList);
    }
}
